<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<title>签到查询</title>
  <link rel="stylesheet" href="../assets/libs/particles/css/style.css">
	<link rel="stylesheet" href="../assets/css/base.css">
	<style type="text/css">
	*{
	margin: 0;
	padding: 0;
	    
	}
html,body{
	height: 100%;
	background-color: #f7fafc;
	}	
	body{
   /*color: #ffffff;*/
	line-height: 1.7;
	text-align: center;
	font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif;
	}
#particles-js {
	position: absolute;
	top: 0;
	left: 0;
}
#wrapper{
			width: 80%;
			padding: 5px;
			margin:5px auto;
			text-align: center;
			border-collapse:collapse;
}
	h3{
			text-align: center;
				font-size: 28px;
		}
		table,table th,table td{
		    border:1px solid #ddd;
		} /*表格带线框,6像素的间距*/ 
		table th,table td{
		    padding:6px
		    
		} /*单元格6像素的间距*/ 
		table th{
		    background-color:#eee
		    
		} /*表头带背景色*/ 
	</style>
</head>
<body>
<div id="particles-js"></div>
<div id="wrapper">
    	<h3>签到记录</h3>
	<table border="1">
		<tr>
			<td>状态</td>
			<td>姓名</td>
			<td>签到地点</td>
			<td>签到时间</td>
			<!-- <td>头像</td> -->
		</tr>
		<?php 
			/*链接数据库*/
			$con = mysql_connect('lcy.pub','syslcy','001011');
			/*链接数据表*/
			$db_selected = mysql_select_db('syssign',$con);
			/*定义编码格式*/
			mysql_query('set names utf8');
			$sql = 'select * from history';
			$res = mysql_query($sql);
			/*长度*/
			$num=mysql_num_rows($res);
			for($i=0;$i<$num;$i++)
			{
				$sql_arr=mysql_fetch_assoc($res);
				$id = $sql_arr['status'];
				$username = $sql_arr['username'];
				$age = $sql_arr['location'];
				$sex = $sql_arr['date'];
				echo "<tr><td>$id</td><td>$username</td><td>$age</td><td>$sex</td></tr>";
			}	

		?>
	</table>
	</div>
	<script src="../assets/libs/jquery-1.12.4/jquery.min.js"></script>
	<script src="../assets/libs/particles/particles.min.js"></script>
	<script src="../assets/libs/particles/js/app.js"></script>
</body>
</html>